﻿@model  AdminUserModel
@{
    ViewBag.Title = "用户修改";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@{ IList<SelectListItem> sexList = new List<SelectListItem>();
   sexList.Add(new SelectListItem() { Text = "男", Value = "false" });
   sexList.Add(new SelectListItem() { Text = "女", Value = "true" });}
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "accountForm", name = "accountForm", onsubmit = "return check()" }))
{

    @Html.HiddenFor(x => x.UserID)
    <div>
        <table class="tb-form">
            <tr>
                <td class="tb-f-lable">
                    <span class="org">*</span>选择部门：
                </td>
                <td>
                    <input type="button" value="点击选择" onclick="SelectParent()" class="i-btn2" />
                    <span id="DepartmentName">@ViewBag.DepartmentName</span>
                    @Html.HiddenFor(x => x.DepartmentID)
                    @Html.HiddenFor(x => x.Level)
                </td>
            </tr>
         @*   <tr>
                <td class="tb-f-lable">
                    <span class="org">*</span>选择职位:
                </td>
                <td>
                    <input type="button" value="点击选择" onclick="SelectJob();" class="i-btn2" />
                    <span id="JobTitle">@ViewBag.JobTitle</span>
                    @Html.HiddenFor(x => x.JobID)
                    @Html.HiddenFor(x => x.JobLevel)
                </td>
            </tr>*@
            <tr>
                <td class="tb-f-lable">
                    <span class="org">*</span>@Html.LabelFor(x => x.UserID)：
                </td>
                <td>
                    @Html.TextBoxFor(x => x.UserID, new { @class = "input-style-d", @maxlength = "20" })
                    @Html.ValidationMessageFor(m => m.UserID)
                </td>
            </tr>
            <tr>
                <td class="tb-f-lable">
                    <span class="org">*</span>@Html.LabelFor(x => x.Password)：
                </td>
                <td>
                    @Html.TextBox("Password", "", new { @type = "password", @class = "input-style-d", @maxlength = "50" })
                    @Html.ValidationMessageFor(m => m.Password)
                </td>
            </tr>
            <tr>
                <td class="tb-f-lable">
                    <span class="org">*</span>@Html.LabelFor(x => x.UserName)：
                </td>
                <td>
                    @Html.TextBoxFor(x => x.UserName, new { @class = "input-style-d", @maxlength = "20" })
                    @Html.ValidationMessageFor(m => m.UserName)
                </td>
            </tr>
            <tr>
                <td class="tb-f-lable">
                    @Html.LabelFor(x => x.Telephone)：
                </td>
                <td>
                    @Html.TextBoxFor(x => x.Telephone, new { @class = "input-style-d", @maxlength = "20" })
                    @Html.ValidationMessageFor(m => m.Telephone)
                </td>
            </tr>
            <tr>
                <td class="tb-f-lable">
                    @Html.LabelFor(x => x.Mobile)：
                </td>
                <td>
                    @Html.TextBoxFor(x => x.Mobile, new { @class = "input-style-d", @maxlength = "20" })
                    @Html.ValidationMessageFor(m => m.Mobile)
                </td>
            </tr>
            <tr>
                <td class="tb-f-lable">
                    @Html.LabelFor(x => x.Sex)：
                </td>
                <td>
                    @Html.DropDownListFor(x => x.Sex, sexList, new { @class = "select-style" })
                    @Html.ValidationMessageFor(m => m.Sex)
                </td>
            </tr>
            <tr>
                <td class="tb-f-lable">
                    @Html.LabelFor(x => x.Address)：
                </td>
                <td>
                    @Html.TextBoxFor(x => x.Address, new { @class = "input-style-d", @maxlength = "100", @style = "width: 400px;" })
                    @Html.ValidationMessageFor(m => m.Address)
                </td>
            </tr>
            <tr>
                <td class="tb-f-lable">
                    @Html.LabelFor(x => x.EMail)：
                </td>
                <td>
                    @Html.TextBoxFor(x => x.EMail, new { @class = "input-style-d", @maxlength = "50", @style = "width: 200px;" })
                    @Html.ValidationMessageFor(m => m.EMail)
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <input type="submit" value="保存" class="i-btn5" />
                    @if (Model.UserID !=0)
                    {
                        <input type="button" class="i-btn5" onclick="SetRole('@(Model != null ? Model.UserID.ToString() : "")');" value="设置权限" />
                    }
                </td>
            </tr>
        </table>
    </div>
    
}
